# $Id: PKGBUILD 68495 2012-03-26 08:43:21Z lfleischer $
# Maintainer: Lukas Fleischer <archlinux at cryptocrack dot de>
# Contributor: Mateusz Herych <heniekk@gmail.com>
# Contributor: Thomas Mader <thezema@gmail.com>
# Contributor: Vinay S Shastry <vinayshastry@gmail.com>
# Contributor: tardo <tardo@nagi-fanboi.net>

pkgname=astyle
pkgver=2.02.1
pkgrel=1
pkgdesc='A free, fast and small automatic formatter for C, C++, C#, and Java source code.'
arch=('i686' 'x86_64')
url='http://sourceforge.net/projects/astyle/'
license=('LGPL')
depends=('gcc-libs')
source=("http://downloads.sourceforge.net/sourceforge/astyle/${pkgname}_${pkgver}_linux.tar.gz")
md5sums=('3e3ef8024c175ef4e1720b7aa4c75202')

build() {
  cd "$srcdir/$pkgname/build/gcc"
  make
}

package() {
  cd "$srcdir/$pkgname/build/gcc"

  install -Dm0755 bin/astyle "$pkgdir/usr/bin/astyle"

  # install documentation (implements FS#23290)
  install -d "$pkgdir/usr/share/doc/$pkgname/"
  for f in ../../doc/*.html; do
    install -m0644 "$f" "$pkgdir/usr/share/doc/$pkgname/"
  done
}
